<template>
  <div class="App">
    <h2>我是App组件</h2>
    <h2 ref="dome">当前求和为:{{n}}</h2>
    <button @click="n+=1">点我n加1</button>
    <button @click="show">点我控制台输出h2的内容</button>
    <hr>
    <person/>
  </div>
</template>
<script>
import Person from './components/Person'
export default {
  name:'App',
  data(){
    return{
      n : 1,
    }
  },
  components: { Person},
  methods:{
    show(){
      console.log(this.$refs.dome.innerText);
    }
  },
}
</script>

<style scoped>
  .App{
    background: teal;
    padding: 20px;
  }
</style>